<?php

namespace app\api\controller;

use app\api\model\ChatSticker;
use app\api\model\ChatStickerCategory;
use think\exception\DbException;
use think\response\Json;

class Sticker extends Common
{
    public function category()
    {
    
         return $this->pass([]);
        // $where = ['is_hidden' => 0];
    
        // $data = ChatStickerCategory::where($where)->field('id, name')->select();
    
        // return $this->pass($data);
    }
    
    public function lists(): Json
    {
        
        return $this->pass([]);
        // $page = $this->params['page'] ?? 1;

        // $where = ['cate_id' => $this->params['cate_id'], 'user_id' => 0, 'is_hidden' => 0];

        // try {
        //     $data = ChatSticker::all(function ($query) use ($where, $page) {
        //         $query->field('id, name, preview')
        //             ->where($where)->order('sort desc, id asc')->page($page, 10);
        //     });
        // } catch (DbException $e) {
        //     return $this->miss($e->getMessage());
        // }

        // foreach ($data as $key => $item) {
        //     $data[$key]['preview'] = changeUrl($item['preview']);
        // }

        // return $this->pass($data);
    }
}
